#ifndef _FALCON_CPP_EXTEND_PARAMETER_HPP
#define _FALCON_CPP_EXTEND_PARAMETER_HPP

#include <falcon/c++/extend_pack.hpp>

#define CPP_EXTEND_PARAMETER(_VARG, _Name) _VARG CPP_EXTEND_PACK _Name
#define CPP_USE_EXTEND_PARAMETER(_Expr) _Expr CPP_EXTEND_PACK

#if __cplusplus >= 201103L
# define CPP_OPTIONAL_EXTEND_PARAMETER(_VARG, _Name) _VARG... _Name
# define CPP_USE_OPTIONAL_EXTEND_PARAMETER(_Expr) _Expr...
# define CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER ,
#else
# define CPP_OPTIONAL_EXTEND_PARAMETER(_VARG, _Name)
# define CPP_USE_OPTIONAL_EXTEND_PARAMETER(_Expr)
# define CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER
#endif

#define CPP_OTHER_OPTIONAL_EXTEND_PARAMETER(_VARG, _Name) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_OPTIONAL_EXTEND_PARAMETER(_VARG, _Name)
#define CPP_USE_OTHER_OPTIONAL_EXTEND_PARAMETER(_Expr) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_USE_OPTIONAL_EXTEND_PARAMETER(_Expr)

#define CPP_TYPENAME_EXTEND_PARAMETER(_Name) CPP_EXTEND_PARAMETER(typename, _Name)
#define CPP_CLASS_EXTEND_PARAMETER(_Name) CPP_EXTEND_PARAMETER(class, _Name)
#define CPP_OPTIONAL_TYPENAME_EXTEND_PARAMETER(_Name) CPP_OPTIONAL_EXTEND_PARAMETER(typename, _Name)
#define CPP_OPTIONAL_CLASS_EXTEND_PARAMETER(_Name) CPP_OPTIONAL_EXTEND_PARAMETER(class, _Name)

#define CPP_OTHER_TYPENAME_EXTEND_PARAMETER(_Name) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_TYPENAME_EXTEND_PARAMETER(_Name)
#define CPP_OTHER_CLASS_EXTEND_PARAMETER(_Name) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_CLASS_EXTEND_PARAMETER(_Name)
#define CPP_OPTIONAL_OTHER_TYPENAME_EXTEND_PARAMETER(_Name) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_OPTIONAL_TYPENAME_EXTEND_PARAMETER(_Name)
#define CPP_OPTIONAL_OTHER_CLASS_EXTEND_PARAMETER(_Name) CPP_SEPERATOR_FOR_OPTIONAL_PARAMETER CPP_OPTIONAL_CLASS_EXTEND_PARAMETER(_Name)

#endif